local CommonOHOH = _G.CommonOHOH;
local M = CommonOHOH.class.new(script,script.Parent.base,script.Parent.Name);
local InstanceManager = CommonOHOH.load.InstanceManager();

local HttpService=game:GetService("HttpService")

function M.new(self, ...)
	return M(self, ...);
end;

function M.ctor(self,map,playerList)

    local battleId=map:GetAttribute("BattleId")
    local levelStr=map:GetAttribute("LevelIdList")
    local levelIdList=HttpService:JSONDecode(levelStr)
    self.player=_G.client.local_player
    M.super.ctor(self,map,levelIdList,playerList,battleId)
    self:AddPrivateComponentByFolder(script.Parent.cli)
    self.player.BattleSateEvent:Action(true,self)

    self.FindAttackTargetEvent=self.player.FindAttackTargetEvent

    self.ReayBattleCtrl=  _G.client:GetComponent(CommonOHOH.load.ReayBattleCtrl())

    self:Action()
end;

--开始战斗
function  M.Action(self)

    task.wait()
    local ctrl=self:GetPrivateComponent("AttCtrl")
    self.player.character:SetCFrame(ctrl:FindPlayerCFrame())
end

--获取退出坐标
function  M.GetExitCFrame(self)
    return   self.ReayBattleCtrl:GetExitBattleCFrame(self:GetId())
end

function M.dtor(self)
    self.player.BattleSateEvent:Action(false)
	M.super.dtor(self);
end;



return M;
